package com.study.juc.interrupt;

/**
 * @program: juc-study
 * @author: jzhou
 * @date: 2022-08-15 16:59
 * @version: 1.0
 * @description: Interrupted静态方法演示
 *  这个方法做了两件事：
 *      1 返回当前线程的中断状态
 *      2 将当前线程的中断状态设为false
 **/
public class InterruptedDemo {
	public static void main(String[] args) throws InterruptedException {
		System.out.println(Thread.currentThread().getName() + "---" + Thread.interrupted());
		System.out.println(Thread.currentThread().getName() + "---" + Thread.interrupted());
		System.out.println("111111");
		Thread.currentThread().interrupt();
		System.out.println("222222");
		System.out.println(Thread.currentThread().getName() + "---" + Thread.interrupted());
		System.out.println(Thread.currentThread().getName() + "---" + Thread.interrupted());
	}
}
